<!doctype html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="java," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1" />






<meta name="description" content="引言   工作中可能会遇到对Excel读取和写入，如果我们自己手动写的话，会很麻烦，但是Apache中有poi工具类。poi工具类封装好了对于Excel读取和写入，我们需要用的时候，直接调用该方法就好了。 注:03和07的写法不一致。区别如下123	// HSSFWorkbook 2003的excel .xls,XSSFWorkbook导入2007的excel   .xlsxHSSFWorkboo">
<meta name="keywords" content="java">
<meta property="og:type" content="article">
<meta property="og:title" content="JAVA读取、写入Excel表格(含03版)">
<meta property="og:url" content="http://yoursite.com/2017/11/10/JAVA读取、写入Excel表格(含03版)/index.html">
<meta property="og:site_name" content="xuwujing&#39;s blog">
<meta property="og:description" content="引言   工作中可能会遇到对Excel读取和写入，如果我们自己手动写的话，会很麻烦，但是Apache中有poi工具类。poi工具类封装好了对于Excel读取和写入，我们需要用的时候，直接调用该方法就好了。 注:03和07的写法不一致。区别如下123	// HSSFWorkbook 2003的excel .xls,XSSFWorkbook导入2007的excel   .xlsxHSSFWorkboo">
<meta property="og:image" content="http://img.blog.csdn.net/20171110134257576?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171110134307674?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171110134743839?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171110134801228?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171110134844129?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:updated_time" content="2017-11-18T02:52:16.290Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="JAVA读取、写入Excel表格(含03版)">
<meta name="twitter:description" content="引言   工作中可能会遇到对Excel读取和写入，如果我们自己手动写的话，会很麻烦，但是Apache中有poi工具类。poi工具类封装好了对于Excel读取和写入，我们需要用的时候，直接调用该方法就好了。 注:03和07的写法不一致。区别如下123	// HSSFWorkbook 2003的excel .xls,XSSFWorkbook导入2007的excel   .xlsxHSSFWorkboo">
<meta name="twitter:image" content="http://img.blog.csdn.net/20171110134257576?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2017/11/10/JAVA读取、写入Excel表格(含03版)/"/>





  <title>JAVA读取、写入Excel表格(含03版) | xuwujing's blog</title>
  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?39c177d10f6e05ddfa113e02139b9c1c";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>










</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">xuwujing's blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2017/11/10/JAVA读取、写入Excel表格(含03版)/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="xuwujing">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/xuwujing.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="xuwujing's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">JAVA读取、写入Excel表格(含03版)</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-11-10T13:54:00+08:00">
                2017-11-10
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/java/" itemprop="url" rel="index">
                    <span itemprop="name">java</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="引言"><a href="#引言" class="headerlink" title="引言"></a>引言</h2><p>   工作中可能会遇到对Excel读取和写入，如果我们自己手动写的话，会很麻烦，但是Apache中有poi工具类。poi工具类封装好了对于Excel读取和写入，我们需要用的时候，直接调用该方法就好了。<br> 注:03和07的写法不一致。<br>区别如下<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">	// HSSFWorkbook 2003的excel .xls,XSSFWorkbook导入2007的excel   .xlsx</div><div class="line">HSSFWorkbook workbook=new HSSFWorkbook(new FileInputStream(new File(file)));</div><div class="line">XSSFWorkbook workbook=new XSSFWorkbook(new FileInputStream(new File(file))));</div></pre></td></tr></table></figure></p>
<h2 id="代码实现"><a href="#代码实现" class="headerlink" title="代码实现"></a>代码实现</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div><div class="line">61</div><div class="line">62</div><div class="line">63</div><div class="line">64</div><div class="line">65</div><div class="line">66</div><div class="line">67</div><div class="line">68</div><div class="line">69</div><div class="line">70</div><div class="line">71</div><div class="line">72</div><div class="line">73</div><div class="line">74</div><div class="line">75</div><div class="line">76</div><div class="line">77</div><div class="line">78</div><div class="line">79</div><div class="line">80</div><div class="line">81</div><div class="line">82</div><div class="line">83</div><div class="line">84</div><div class="line">85</div><div class="line">86</div><div class="line">87</div><div class="line">88</div><div class="line">89</div><div class="line">90</div><div class="line">91</div><div class="line">92</div><div class="line">93</div><div class="line">94</div><div class="line">95</div><div class="line">96</div><div class="line">97</div><div class="line">98</div><div class="line">99</div><div class="line">100</div><div class="line">101</div><div class="line">102</div><div class="line">103</div><div class="line">104</div><div class="line">105</div><div class="line">106</div><div class="line">107</div><div class="line">108</div><div class="line">109</div><div class="line">110</div><div class="line">111</div><div class="line">112</div><div class="line">113</div><div class="line">114</div><div class="line">115</div><div class="line">116</div><div class="line">117</div><div class="line">118</div><div class="line">119</div><div class="line">120</div><div class="line">121</div><div class="line">122</div><div class="line">123</div><div class="line">124</div><div class="line">125</div><div class="line">126</div></pre></td><td class="code"><pre><div class="line">import java.io.File;</div><div class="line">import java.io.FileInputStream;</div><div class="line">import java.io.FileNotFoundException;</div><div class="line">import java.io.FileOutputStream;</div><div class="line">import java.io.IOException;</div><div class="line">import java.util.ArrayList;</div><div class="line">import java.util.List;</div><div class="line"></div><div class="line">import org.apache.poi.ss.usermodel.Cell;</div><div class="line">import org.apache.poi.ss.usermodel.Row;</div><div class="line">import org.apache.poi.ss.usermodel.Sheet;</div><div class="line">import org.apache.poi.xssf.usermodel.XSSFWorkbook;</div><div class="line"></div><div class="line">import com.alibaba.fastjson.JSONObject;</div><div class="line"></div><div class="line"></div><div class="line"></div><div class="line">/**</div><div class="line"> * </div><div class="line">* Title: excelTest</div><div class="line">* Description: excel表格读取</div><div class="line">* 注意:引用poi 架包版本要一致</div><div class="line">* 如:</div><div class="line">* poi-3.13.jar</div><div class="line">* poi-ooxml-3.13.jar</div><div class="line">* poi-ooxml-schemas-3.13.jar</div><div class="line">* poi-scratchpad-3.13.jar</div><div class="line">* 这些架包版本随意</div><div class="line">* stax-api.jar</div><div class="line">* xmlbeans.jar</div><div class="line">* dom4j.jar</div><div class="line">* Version:1.0.0  </div><div class="line">* @author pancm</div><div class="line"> */</div><div class="line">public class excelTest &#123;</div><div class="line">	</div><div class="line">	private static final String path=&quot;D:\\file\\test.xlsx&quot;; </div><div class="line">	private static final String path1=&quot;D:\\file\\test1.xlsx&quot;; </div><div class="line">	</div><div class="line">	public static void main(String[] args) throws FileNotFoundException, IOException &#123;</div><div class="line">		readExcel(path);</div><div class="line">		writeExcel(path1);</div><div class="line">	&#125;</div><div class="line">    </div><div class="line">	/**</div><div class="line">	 * 读取Excel表格内容</div><div class="line">	 * @throws FileNotFoundException</div><div class="line">	 * @throws IOException</div><div class="line">	 */</div><div class="line">	@SuppressWarnings(&#123; &quot;rawtypes&quot;, &quot;unchecked&quot; &#125;)</div><div class="line">	private static void readExcel(String str) throws FileNotFoundException, IOException&#123;</div><div class="line">		File file=new File(str);</div><div class="line">		// HSSFWorkbook 2003的excel .xls,XSSFWorkbook导入2007的excel   .xlsx</div><div class="line">//		HSSFWorkbook workbook=new HSSFWorkbook(new FileInputStream(new File(file)));</div><div class="line">		XSSFWorkbook workbook=new XSSFWorkbook(new FileInputStream(file));</div><div class="line">		 Sheet sheet=workbook.getSheetAt(0);//读取第一个 sheet</div><div class="line">		 List list= new ArrayList&lt;&gt;();</div><div class="line">		 Row row=null;</div><div class="line">		 int count=sheet.getPhysicalNumberOfRows();</div><div class="line">		//逐行处理 excel 数据</div><div class="line">		for (int i = 1; i &lt;count; i++) &#123;</div><div class="line">			 JSONObject json=new JSONObject();</div><div class="line">			  row=sheet.getRow(i);</div><div class="line">			 Cell cell0 = row.getCell(0);</div><div class="line">			 //设置取值为String</div><div class="line">			 //整数数据要转，否则会变成浮点数</div><div class="line">			cell0.setCellType(Cell.CELL_TYPE_STRING);</div><div class="line">			Cell cell1 = row.getCell(1); </div><div class="line">			cell1.setCellType(Cell.CELL_TYPE_STRING);</div><div class="line">			json.put(&quot;Id&quot;,cell0.toString()); //编号</div><div class="line">			json.put(&quot;Name&quot;,cell1.toString()); //名称</div><div class="line">			list.add(json);</div><div class="line">			System.out.println(&quot;json:&quot;+json);</div><div class="line">		&#125;</div><div class="line">		workbook.close();</div><div class="line">		System.out.println(&quot;list:&quot;+list);</div><div class="line">	&#125;</div><div class="line">	</div><div class="line">	/**</div><div class="line">	 * 写入Excel表格内容</div><div class="line">	 * @throws FileNotFoundException</div><div class="line">	 * @throws IOException</div><div class="line">	 */</div><div class="line">	@SuppressWarnings(&#123; &quot;resource&quot;, &quot;rawtypes&quot;, &quot;unchecked&quot; &#125;)</div><div class="line">	private static void writeExcel(String str) throws FileNotFoundException, IOException&#123;</div><div class="line">		File file=new File(str);</div><div class="line">		// HSSFWorkbook 2003的excel .xls,XSSFWorkbook导入2007的excel   .xlsx</div><div class="line">//		HSSFWorkbook workbook=new HSSFWorkbook(new FileInputStream(new File(file)));</div><div class="line">		XSSFWorkbook workbook=new XSSFWorkbook(new FileInputStream(file));</div><div class="line">		List resultList =new ArrayList&lt;&gt;();</div><div class="line">		</div><div class="line">		Sheet sheet1 = workbook.createSheet();//创建 sheet 对象</div><div class="line">		Row row = sheet1.createRow(0);//第一行，标题</div><div class="line">		row.createCell(0).setCellValue(&quot;A&quot;);</div><div class="line">		row.createCell(1).setCellValue(&quot;B&quot;);</div><div class="line">		row.createCell(2).setCellValue(&quot;C&quot;);</div><div class="line">		row.createCell(3).setCellValue(&quot;D&quot;);</div><div class="line">		row.createCell(4).setCellValue(&quot;E&quot;);</div><div class="line">		//拼接数据</div><div class="line">		for(int i=1;i&lt;=10;i++)&#123;</div><div class="line">			JSONObject json1=new JSONObject();</div><div class="line">			json1.put(&quot;A&quot;, i);</div><div class="line">			json1.put(&quot;B&quot;, i*2);</div><div class="line">			json1.put(&quot;C&quot;, i*3);</div><div class="line">			json1.put(&quot;D&quot;, i*4);</div><div class="line">			json1.put(&quot;E&quot;, i*5);</div><div class="line">			resultList.add(json1);</div><div class="line">		&#125;</div><div class="line">		System.out.println(&quot;resultList:&quot;+resultList);</div><div class="line">		Row row1;</div><div class="line">		for (int i = 1, len = resultList.size(); i &lt;=len; i++) &#123;//循环创建数据行</div><div class="line">			//因为第一行已经设置了，所以从第二行开始</div><div class="line">			row1 = sheet1.createRow(i);</div><div class="line">			JSONObject json=(JSONObject) resultList.get(i-1);</div><div class="line">			row1.createCell(0).setCellValue(json.getString(&quot;A&quot;));</div><div class="line">			row1.createCell(1).setCellValue(json.getString(&quot;B&quot;));</div><div class="line">			row1.createCell(2).setCellValue(json.getString(&quot;C&quot;));</div><div class="line">			row1.createCell(3).setCellValue(json.getString(&quot;D&quot;));</div><div class="line">			row1.createCell(4).setCellValue(json.getString(&quot;E&quot;));</div><div class="line">		&#125;</div><div class="line">		FileOutputStream fos = new FileOutputStream(path1); </div><div class="line">		workbook.write(fos);//写文件</div><div class="line">		fos.close();</div><div class="line">		System.out.println(&quot;写入成功！&quot;);</div><div class="line">	&#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<h2 id="示例图"><a href="#示例图" class="headerlink" title="示例图"></a>示例图</h2><h3 id="读取Excel"><a href="#读取Excel" class="headerlink" title="读取Excel"></a>读取Excel</h3><p>新建一个Excel表格，设置表格内容。<br><img src="http://img.blog.csdn.net/20171110134257576?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>关闭此Excel，运行代码，打印获取的数据。<br><img src="http://img.blog.csdn.net/20171110134307674?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<h3 id="写入Excel"><a href="#写入Excel" class="headerlink" title="写入Excel"></a>写入Excel</h3><p>创建一个新的Excel。<br><img src="http://img.blog.csdn.net/20171110134743839?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>关闭此Excel，运行代码<br><img src="http://img.blog.csdn.net/20171110134801228?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>再次打开此Excel<br><img src="http://img.blog.csdn.net/20171110134844129?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/java/" rel="tag"># java</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/11/09/一位大牛对于写技术博客的一些建议/" rel="next" title="一位大牛对于写技术博客的一些建议">
                <i class="fa fa-chevron-left"></i> 一位大牛对于写技术博客的一些建议
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/11/13/大数据初学者应该知道的知识/" rel="prev" title="大数据初学者应该知道的知识">
                大数据初学者应该知道的知识 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/xuwujing.png"
               alt="xuwujing" />
          <p class="site-author-name" itemprop="name">xuwujing</p>
           
              <p class="site-description motion-element" itemprop="description">The way of the future!</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives/">
                <span class="site-state-item-count">56</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">20</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">36</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/xuwujing" target="_blank" title="github">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  github
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://blog.csdn.net/qazwsxpcm?viewmode=list" target="_blank" title="csdn">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  csdn
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://home.cnblogs.com/u/xuwujing/" target="_blank" title="cnblogs">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  cnblogs
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.woainia.site/" title="woainia" target="_blank">woainia</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://cmsblogs.com/" title="chenssy" target="_blank">chenssy</a>
                </li>
              
            </ul>
          </div>
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#引言"><span class="nav-number">1.</span> <span class="nav-text">引言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#代码实现"><span class="nav-number">2.</span> <span class="nav-text">代码实现</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#示例图"><span class="nav-number">3.</span> <span class="nav-text">示例图</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#读取Excel"><span class="nav-number">3.1.</span> <span class="nav-text">读取Excel</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#写入Excel"><span class="nav-number">3.2.</span> <span class="nav-text">写入Excel</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">xuwujing</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  





  






  





  

  

  

  

  

  

</body>
</html>
